﻿using System;
using System.Xml.Linq;
using System.Collections.Generic;

namespace CodeCounsel.SharePoint.RibbonDesigner.Model
{
    [XName("Layout", Namespaces.CommandUIText)]
    public class Layout
        : DomainElement
    {
        public bool IsPopup
        {
            get { return Title == "Popup"; }
        }

        public string Title
        {
            get { return DataModel.GetAttributeValue(Schema.Title); }
            set { DataModel.SetAttributeValue(Schema.Title, value); }
        }

        public string LayoutTitle
        {
            get { return DataModel.GetAttributeValue(Schema.LayoutTitle); }
            set { DataModel.SetAttributeValue(Schema.LayoutTitle, value); }
        }

        public IEnumerable<DomainElement> Sections
        {
            get { return Children; }
        }

        public Layout(XElement dataModel, DomainModelSource source)
            : base(dataModel, source)
        {
        }

        public Layout()
        {
        }
    }
}
